<template>
  <div class="onlist_order" @click="toggle_order">
    <div class="list_item">
      <div class="item_top">
        <img src="../../static/images/organize_team/sp.png" alt />
        <span>{{organizes.business_name}}</span>
      </div>
      <div class="wc">
        <span>{{organizes.order_status}}</span>
      </div>
    </div>
    <div class="wc_info">
      <div class="wcimg">
        <img :src="organizes.logo" />
      </div>
      <div class="wcss">
        <div class="zdo">
          <span>组队类型：</span>
          <span>{{organizes.organize_type}}</span>
        </div>
        <div>
          <span>下单时间：</span>
          <span>{{organizes.order_add_time}}</span>
        </div>
        <div>
          <span>人数：</span>
          <span>{{organizes.people_num}}人</span>
        </div>
        <div>
          <span>订单总价：</span>
          <span>￥{{organizes.total_price}}</span>
        </div>
      </div>
      <div class="pj" v-if="show_payment">
        <yd-button type="danger" shape="circle" class="ob" @click.stop="to_pay_ment">去付款</yd-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "TeamResult",
  props: {
    organizes: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  data() {
    return {};
  },
  computed: {
    /*
     * 是否显示待付款
     * 作者：gzt
     * 时间：2019-11-27 16:19:36
     */
    show_payment() {
      if (this.organizes.order_status == "待支付") {
        return true;
      }
      return false;
    }
  },

  methods: {
    /*
     * 跳转至订单详情页
     * 作者：gzt
     * 时间：2019-11-27 16:22:24
     */
    to_order_detail() {
      this.$router.push({
        name: "organize_order",
        params: {
          order_id: this.organizes.order_id
        }
      });
    },
    /*
     * 跳转至订单支付页面
     * 作者：gzt
     * 时间：2019-11-27 16:29:39
     */
    to_pay_ment() {
      this.$router.push({
        name: "payment",
        params: {
          order_id: this.organizes.order_id
        }
      });
    },
    /*
     * 切换订单
     * 作者：gzt
     * 时间：2019-11-27 16:30:58
     */
    toggle_order() {
      console.log(111);
      if (this.organizes.order_status == "待支付") {
        this.to_pay_ment();
      } else {
        this.to_order_detail();
      }
    }
  }
};
</script>

<style >
.onlist_order {
  padding: 0.2rem;
  background: #fff;
  border-radius: 5px;
  margin-bottom: 0.3rem;
}
.list_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f5f5f5;
  padding-bottom: 0.2rem;
}
.item_top {
  display: flex;
  align-items: center;
  flex: 1;
}
.item_top img {
  height: 0.5rem;
  padding-right: 0.2rem;
}
.item_top span {
  font-size: 0.3rem;
  font-weight: bold;
}
.wc {
  width: 1rem;
}
.wc span {
  font-size: 0.28rem;
}
.wc_info {
  padding-top: 0.2rem;
  display: flex;
  justify-content: space-between;
  text-align: left;
}
.wcimg {
  height: 1.3rem;
  width: 1.6rem;
}
.wcimg img {
  height: 1.3rem;
  width: 1.3rem;
  border-radius: 4px;
}
.zdo {
  color: #e27413;
  font-weight: bold;
  font-size: 0.28rem;
}
.wcss {
  flex: 1;
  color: #999;
}
.pj {
  width: 1。2rem;
  display: flex;
  align-items: center;
}
.bt {
  height: 0.4rem;
  border: 1px solid rgb(230, 140, 6);
}
.ob {
  height: 0.45rem;
}
</style>
